.class public Lcom/netease/newsreader/util/BaseImageDownloader;
.super Ljava/lang/Object;
.source "BaseImageDownloader.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/netease/newsreader/util/BaseImageDownloader$BitmapDownloaderTask;,
        Lcom/netease/newsreader/util/BaseImageDownloader$DownloadedDrawable;,
        Lcom/netease/newsreader/util/BaseImageDownloader$FlushedInputStream;,
        Lcom/netease/newsreader/util/BaseImageDownloader$Mode;
    }
.end annotation


# static fields
.field private static synthetic $SWITCH_TABLE$com$netease$newsreader$util$BaseImageDownloader$Mode:[I = null

.field private static final DELAY_BEFORE_PURGE:I = 0xea60

.field private static final HARD_CACHE_CAPACITY:I = 0x3c

.field private static final sSoftBitmapCache:Ljava/util/concurrent/ConcurrentHashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/concurrent/ConcurrentHashMap",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/ref/SoftReference",
            "<",
            "Landroid/graphics/Bitmap;",
            ">;>;"
        }
    .end annotation
.end field


# instance fields
.field private bitmapH:I

.field private bitmapW:I

.field private cut:Ljava/lang/String;

.field private flag:Ljava/lang/String;

.field private mContext:Landroid/content/Context;

.field private mDefaultBm:Landroid/graphics/Bitmap;

.field private mThread:Ljava/lang/Thread;

.field private mode:Lcom/netease/newsreader/util/BaseImageDownloader$Mode;

.field private final purgeHandler:Landroid/os/Handler;

.field private final purger:Ljava/lang/Runnable;

.field private final sHardBitmapCache:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Landroid/graphics/Bitmap;",
            ">;"
        }
    .end annotation
.end field

.field private set_prefs:Landroid/content/SharedPreferences;


# direct methods
.method static synthetic $SWITCH_TABLE$com$netease$newsreader$util$BaseImageDownloader$Mode()[I
    .locals 3

    .prologue
    .line 46
    sget-object v0, Lcom/netease/newsreader/util/BaseImageDownloader;->$SWITCH_TABLE$com$netease$newsreader$util$BaseImageDownloader$Mode:[I

    if-eqz v0, :cond_0

    :goto_0
    return-object v0

    :cond_0
    invoke-static {}, Lcom/netease/newsreader/util/BaseImageDownloader$Mode;->values()[Lcom/netease/newsreader/util/BaseImageDownloader$Mode;

    move-result-object v0

    array-length v0, v0

    new-array v0, v0, [I

    :try_start_0
    sget-object v1, Lcom/netease/newsreader/util/BaseImageDownloader$Mode;->CORRECT:Lcom/netease/newsreader/util/BaseImageDownloader$Mode;

    invoke-virtual {v1}, Lcom/netease/newsreader/util/BaseImageDownloader$Mode;->ordinal()I

    move-result v1

    const/4 v2, 0x3

    aput v2, v0, v1
    :try_end_0
    .catch Ljava/lang/NoSuchFieldError; {:try_start_0 .. :try_end_0} :catch_2

    :goto_1
    :try_start_1
    sget-object v1, Lcom/netease/newsreader/util/BaseImageDownloader$Mode;->NO_ASYNC_TASK:Lcom/netease/newsreader/util/BaseImageDownloader$Mode;

    invoke-virtual {v1}, Lcom/netease/newsreader/util/BaseImageDownloader$Mode;->ordinal()I

    move-result v1

    const/4 v2, 0x1

    aput v2, v0, v1
    :try_end_1
    .catch Ljava/lang/NoSuchFieldError; {:try_start_1 .. :try_end_1} :catch_1

    :goto_2
    :try_start_2
    sget-object v1, Lcom/netease/newsreader/util/BaseImageDownloader$Mode;->NO_DOWNLOADED_DRAWABLE:Lcom/netease/newsreader/util/BaseImageDownloader$Mode;

    invoke-virtual {v1}, Lcom/netease/newsreader/util/BaseImageDownloader$Mode;->ordinal()I

    move-result v1

    const/4 v2, 0x2

    aput v2, v0, v1
    :try_end_2
    .catch Ljava/lang/NoSuchFieldError; {:try_start_2 .. :try_end_2} :catch_0

    :goto_3
    sput-object v0, Lcom/netease/newsreader/util/BaseImageDownloader;->$SWITCH_TABLE$com$netease$newsreader$util$BaseImageDownloader$Mode:[I

    goto :goto_0

    :catch_0
    move-exception v1

    goto :goto_3

    :catch_1
    move-exception v1

    goto :goto_2

    :catch_2
    move-exception v1

    goto :goto_1
.end method

.method static constructor <clinit>()V
    .locals 2

    .prologue
    .line 670
    new-instance v0, Ljava/util/concurrent/ConcurrentHashMap;

    const/16 v1, 0x1e

    invoke-direct {v0, v1}, Ljava/util/concurrent/ConcurrentHashMap;-><init>(I)V

    .line 669
    sput-object v0, Lcom/netease/newsreader/util/BaseImageDownloader;->sSoftBitmapCache:Ljava/util/concurrent/ConcurrentHashMap;

    .line 46
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/graphics/Bitmap;)V
    .locals 5
    .parameter "context"
    .parameter "defaultBm"

    .prologue
    const/4 v1, 0x0

    const/4 v4, 0x0

    .line 57
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 50
    sget-object v0, Lcom/netease/newsreader/util/BaseImageDownloader$Mode;->CORRECT:Lcom/netease/newsreader/util/BaseImageDownloader$Mode;

    iput-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mode:Lcom/netease/newsreader/util/BaseImageDownloader$Mode;

    .line 51
    iput-object v1, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mContext:Landroid/content/Context;

    .line 52
    iput-object v1, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mDefaultBm:Landroid/graphics/Bitmap;

    .line 656
    new-instance v0, Lcom/netease/newsreader/util/BaseImageDownloader$1;

    const/16 v1, 0x1e

    const/high16 v2, 0x3f40

    const/4 v3, 0x1

    invoke-direct {v0, p0, v1, v2, v3}, Lcom/netease/newsreader/util/BaseImageDownloader$1;-><init>(Lcom/netease/newsreader/util/BaseImageDownloader;IFZ)V

    iput-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->sHardBitmapCache:Ljava/util/HashMap;

    .line 672
    new-instance v0, Landroid/os/Handler;

    invoke-direct {v0}, Landroid/os/Handler;-><init>()V

    iput-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->purgeHandler:Landroid/os/Handler;

    .line 674
    new-instance v0, Lcom/netease/newsreader/util/BaseImageDownloader$2;

    invoke-direct {v0, p0}, Lcom/netease/newsreader/util/BaseImageDownloader$2;-><init>(Lcom/netease/newsreader/util/BaseImageDownloader;)V

    iput-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->purger:Ljava/lang/Runnable;

    .line 745
    iput v4, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapW:I

    .line 746
    iput v4, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapH:I

    .line 58
    iput-object p1, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mContext:Landroid/content/Context;

    .line 59
    iput-object p2, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mDefaultBm:Landroid/graphics/Bitmap;

    .line 60
    iget-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mContext:Landroid/content/Context;

    invoke-static {v0}, Landroid/preference/PreferenceManager;->getDefaultSharedPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;

    move-result-object v0

    iput-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->set_prefs:Landroid/content/SharedPreferences;

    .line 61
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/graphics/Bitmap;IILjava/lang/String;)V
    .locals 5
    .parameter "context"
    .parameter "defaultBm"
    .parameter "width"
    .parameter "height"
    .parameter "c"

    .prologue
    const/4 v1, 0x0

    const/4 v4, 0x0

    .line 63
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 50
    sget-object v0, Lcom/netease/newsreader/util/BaseImageDownloader$Mode;->CORRECT:Lcom/netease/newsreader/util/BaseImageDownloader$Mode;

    iput-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mode:Lcom/netease/newsreader/util/BaseImageDownloader$Mode;

    .line 51
    iput-object v1, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mContext:Landroid/content/Context;

    .line 52
    iput-object v1, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mDefaultBm:Landroid/graphics/Bitmap;

    .line 656
    new-instance v0, Lcom/netease/newsreader/util/BaseImageDownloader$1;

    const/16 v1, 0x1e

    const/high16 v2, 0x3f40

    const/4 v3, 0x1

    invoke-direct {v0, p0, v1, v2, v3}, Lcom/netease/newsreader/util/BaseImageDownloader$1;-><init>(Lcom/netease/newsreader/util/BaseImageDownloader;IFZ)V

    iput-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->sHardBitmapCache:Ljava/util/HashMap;

    .line 672
    new-instance v0, Landroid/os/Handler;

    invoke-direct {v0}, Landroid/os/Handler;-><init>()V

    iput-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->purgeHandler:Landroid/os/Handler;

    .line 674
    new-instance v0, Lcom/netease/newsreader/util/BaseImageDownloader$2;

    invoke-direct {v0, p0}, Lcom/netease/newsreader/util/BaseImageDownloader$2;-><init>(Lcom/netease/newsreader/util/BaseImageDownloader;)V

    iput-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->purger:Ljava/lang/Runnable;

    .line 745
    iput v4, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapW:I

    .line 746
    iput v4, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapH:I

    .line 64
    iput-object p1, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mContext:Landroid/content/Context;

    .line 65
    iput-object p2, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mDefaultBm:Landroid/graphics/Bitmap;

    .line 66
    iput p3, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapW:I

    .line 67
    iput p4, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapH:I

    .line 68
    iput-object p5, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->cut:Ljava/lang/String;

    .line 69
    iget-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mContext:Landroid/content/Context;

    invoke-static {v0}, Landroid/preference/PreferenceManager;->getDefaultSharedPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;

    move-result-object v0

    iput-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->set_prefs:Landroid/content/SharedPreferences;

    .line 70
    return-void
.end method

.method static synthetic access$0()Ljava/util/concurrent/ConcurrentHashMap;
    .locals 1

    .prologue
    .line 669
    sget-object v0, Lcom/netease/newsreader/util/BaseImageDownloader;->sSoftBitmapCache:Ljava/util/concurrent/ConcurrentHashMap;

    return-object v0
.end method

.method static synthetic access$1(Lcom/netease/newsreader/util/BaseImageDownloader;)Landroid/graphics/Bitmap;
    .locals 1
    .parameter

    .prologue
    .line 52
    iget-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mDefaultBm:Landroid/graphics/Bitmap;

    return-object v0
.end method

.method static synthetic access$2(Lcom/netease/newsreader/util/BaseImageDownloader;Ljava/lang/String;Landroid/graphics/Bitmap;)V
    .locals 0
    .parameter
    .parameter
    .parameter

    .prologue
    .line 684
    invoke-direct {p0, p1, p2}, Lcom/netease/newsreader/util/BaseImageDownloader;->addBitmapToCache(Ljava/lang/String;Landroid/graphics/Bitmap;)V

    return-void
.end method

.method static synthetic access$3(Landroid/widget/ImageView;)Lcom/netease/newsreader/util/BaseImageDownloader$BitmapDownloaderTask;
    .locals 1
    .parameter

    .prologue
    .line 335
    invoke-static {p0}, Lcom/netease/newsreader/util/BaseImageDownloader;->getBitmapDownloaderTask(Landroid/widget/ImageView;)Lcom/netease/newsreader/util/BaseImageDownloader$BitmapDownloaderTask;

    move-result-object v0

    return-object v0
.end method

.method static synthetic access$4(Lcom/netease/newsreader/util/BaseImageDownloader;)Ljava/lang/Thread;
    .locals 1
    .parameter

    .prologue
    .line 54
    iget-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mThread:Ljava/lang/Thread;

    return-object v0
.end method

.method private addBitmapToCache(Ljava/lang/String;Landroid/graphics/Bitmap;)V
    .locals 2
    .parameter "url"
    .parameter "bitmap"

    .prologue
    .line 685
    if-eqz p2, :cond_0

    .line 686
    iget-object v1, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->sHardBitmapCache:Ljava/util/HashMap;

    monitor-enter v1

    .line 687
    :try_start_0
    iget-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->sHardBitmapCache:Ljava/util/HashMap;

    invoke-virtual {v0, p1, p2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 686
    monitor-exit v1

    .line 690
    :cond_0
    return-void

    .line 686
    :catchall_0
    move-exception v0

    monitor-exit v1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v0
.end method

.method private static cancelPotentialDownload(Ljava/lang/String;Landroid/widget/ImageView;)Z
    .locals 4
    .parameter "url"
    .parameter "imageView"

    .prologue
    const/4 v2, 0x1

    .line 316
    invoke-static {p1}, Lcom/netease/newsreader/util/BaseImageDownloader;->getBitmapDownloaderTask(Landroid/widget/ImageView;)Lcom/netease/newsreader/util/BaseImageDownloader$BitmapDownloaderTask;

    move-result-object v0

    .line 318
    .local v0, bitmapDownloaderTask:Lcom/netease/newsreader/util/BaseImageDownloader$BitmapDownloaderTask;
    if-eqz v0, :cond_1

    .line 319
    invoke-static {v0}, Lcom/netease/newsreader/util/BaseImageDownloader$BitmapDownloaderTask;->access$2(Lcom/netease/newsreader/util/BaseImageDownloader$BitmapDownloaderTask;)Ljava/lang/String;

    move-result-object v1

    .line 320
    .local v1, bitmapUrl:Ljava/lang/String;
    if-eqz v1, :cond_0

    invoke-virtual {v1, p0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_2

    .line 321
    :cond_0
    invoke-virtual {v0, v2}, Lcom/netease/newsreader/util/BaseImageDownloader$BitmapDownloaderTask;->cancel(Z)Z

    .line 327
    .end local v1           #bitmapUrl:Ljava/lang/String;
    :cond_1
    :goto_0
    return v2

    .line 324
    .restart local v1       #bitmapUrl:Ljava/lang/String;
    :cond_2
    const/4 v2, 0x0

    goto :goto_0
.end method

.method private downloadImageforBatche(Ljava/lang/String;)V
    .locals 10
    .parameter "url"

    .prologue
    .line 355
    if-eqz p1, :cond_0

    :try_start_0
    const-string v7, ""

    invoke-virtual {p1, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v7

    if-eqz v7, :cond_1

    .line 400
    :cond_0
    :goto_0
    return-void

    .line 359
    :cond_1
    new-instance v2, Lorg/apache/http/params/BasicHttpParams;

    invoke-direct {v2}, Lorg/apache/http/params/BasicHttpParams;-><init>()V

    .line 360
    .local v2, httpParams:Lorg/apache/http/params/HttpParams;
    const/16 v7, 0x7530

    invoke-static {v2, v7}, Lorg/apache/http/params/HttpConnectionParams;->setConnectionTimeout(Lorg/apache/http/params/HttpParams;I)V

    .line 361
    const/16 v7, 0x7530

    invoke-static {v2, v7}, Lorg/apache/http/params/HttpConnectionParams;->setSoTimeout(Lorg/apache/http/params/HttpParams;I)V

    .line 362
    invoke-static {v2}, Lcom/netease/newsreader/util/NeteaseHttpClient;->getHttpClient(Lorg/apache/http/params/HttpParams;)Lorg/apache/http/impl/client/DefaultHttpClient;

    move-result-object v1

    .line 363
    .local v1, httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    iget-object v7, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mContext:Landroid/content/Context;

    invoke-static {v7}, Lcom/netease/newsreader/util/Tools;->isCMWAPMobileNet(Landroid/content/Context;)Z

    move-result v7

    if-eqz v7, :cond_5

    .line 364
    new-instance v4, Lorg/apache/http/HttpHost;

    const-string v7, "10.0.0.172"

    const/16 v8, 0x50

    const-string v9, "http"

    invoke-direct {v4, v7, v8, v9}, Lorg/apache/http/HttpHost;-><init>(Ljava/lang/String;ILjava/lang/String;)V

    .line 365
    .local v4, proxy:Lorg/apache/http/HttpHost;
    invoke-virtual {v1}, Lorg/apache/http/impl/client/DefaultHttpClient;->getParams()Lorg/apache/http/params/HttpParams;

    move-result-object v7

    const-string v8, "http.route.default-proxy"

    invoke-interface {v7, v8, v4}, Lorg/apache/http/params/HttpParams;->setParameter(Ljava/lang/String;Ljava/lang/Object;)Lorg/apache/http/params/HttpParams;

    .line 369
    .end local v4           #proxy:Lorg/apache/http/HttpHost;
    :goto_1
    new-instance v5, Lorg/apache/http/client/methods/HttpGet;

    invoke-direct {v5, p1}, Lorg/apache/http/client/methods/HttpGet;-><init>(Ljava/lang/String;)V

    .line 370
    .local v5, request:Lorg/apache/http/client/methods/HttpGet;
    invoke-virtual {v1, v5}, Lorg/apache/http/impl/client/DefaultHttpClient;->execute(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/HttpResponse;

    move-result-object v6

    .line 371
    .local v6, response:Lorg/apache/http/HttpResponse;
    invoke-interface {v6}, Lorg/apache/http/HttpResponse;->getEntity()Lorg/apache/http/HttpEntity;

    move-result-object v7

    invoke-interface {v7}, Lorg/apache/http/HttpEntity;->getContent()Ljava/io/InputStream;

    move-result-object v3

    .line 373
    .local v3, is:Ljava/io/InputStream;
    if-eqz v3, :cond_0

    .line 376
    new-instance v7, Lcom/netease/newsreader/util/BaseImageDownloader$FlushedInputStream;

    invoke-direct {v7, v3}, Lcom/netease/newsreader/util/BaseImageDownloader$FlushedInputStream;-><init>(Ljava/io/InputStream;)V

    invoke-static {v7}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 379
    .local v0, bm:Landroid/graphics/Bitmap;
    if-eqz v0, :cond_4

    .line 380
    iget v7, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapW:I

    if-eqz v7, :cond_2

    iget v7, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapH:I

    if-eqz v7, :cond_2

    iget-object v7, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->cut:Ljava/lang/String;

    if-nez v7, :cond_2

    .line 381
    iget-object v7, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mContext:Landroid/content/Context;

    iget v8, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapW:I

    iget v9, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapH:I

    invoke-static {v7, v0, v8, v9}, Lcom/netease/newsreader/util/PicUtil;->resizeBitmap(Landroid/content/Context;Landroid/graphics/Bitmap;II)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 383
    :cond_2
    const-string v7, "Y"

    iget-object v8, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->cut:Ljava/lang/String;

    invoke-virtual {v7, v8}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v7

    if-eqz v7, :cond_3

    .line 384
    iget v7, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapW:I

    iget v8, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapH:I

    invoke-static {v0, v7, v8}, Lcom/netease/newsreader/util/PicUtil;->cutBitmap(Landroid/graphics/Bitmap;II)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 386
    :cond_3
    const-string v7, "/"

    invoke-virtual {p1, v7}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v7

    add-int/lit8 v7, v7, 0x1

    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v8

    invoke-virtual {p1, v7, v8}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v7

    invoke-static {v7, v0}, Lcom/netease/newsreader/util/PicUtil;->saveMyBitmap(Ljava/lang/String;Landroid/graphics/Bitmap;)Z

    .line 387
    invoke-virtual {v0}, Landroid/graphics/Bitmap;->recycle()V

    .line 388
    const/4 v0, 0x0

    .line 393
    :cond_4
    invoke-virtual {v3}, Ljava/io/InputStream;->close()V

    goto/16 :goto_0

    .line 395
    .end local v0           #bm:Landroid/graphics/Bitmap;
    .end local v1           #httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .end local v2           #httpParams:Lorg/apache/http/params/HttpParams;
    .end local v3           #is:Ljava/io/InputStream;
    .end local v5           #request:Lorg/apache/http/client/methods/HttpGet;
    .end local v6           #response:Lorg/apache/http/HttpResponse;
    :catch_0
    move-exception v7

    goto/16 :goto_0

    .line 367
    .restart local v1       #httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .restart local v2       #httpParams:Lorg/apache/http/params/HttpParams;
    :cond_5
    invoke-virtual {v1}, Lorg/apache/http/impl/client/DefaultHttpClient;->getParams()Lorg/apache/http/params/HttpParams;

    move-result-object v7

    const-string v8, "http.route.default-proxy"

    invoke-interface {v7, v8}, Lorg/apache/http/params/HttpParams;->removeParameter(Ljava/lang/String;)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_1
.end method

.method private forceDownload(Ljava/lang/String;)Landroid/graphics/Bitmap;
    .locals 2
    .parameter "url"

    .prologue
    const/4 v0, 0x0

    .line 292
    if-nez p1, :cond_0

    .line 304
    :goto_0
    return-object v0

    .line 299
    :cond_0
    :try_start_0
    invoke-virtual {p0, p1}, Lcom/netease/newsreader/util/BaseImageDownloader;->downloadBitmap(Ljava/lang/String;)Landroid/graphics/Bitmap;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    .line 302
    .local v0, bitmap:Landroid/graphics/Bitmap;
    goto :goto_0

    .line 303
    .end local v0           #bitmap:Landroid/graphics/Bitmap;
    :catch_0
    move-exception v1

    .line 304
    .local v1, e:Ljava/lang/Exception;
    goto :goto_0
.end method

.method private forceDownload(Ljava/lang/String;Landroid/widget/ImageView;)V
    .locals 6
    .parameter "url"
    .parameter "imageView"

    .prologue
    .line 251
    if-nez p1, :cond_1

    .line 252
    iget-object v4, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mDefaultBm:Landroid/graphics/Bitmap;

    if-eqz v4, :cond_0

    .line 253
    iget-object v4, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mDefaultBm:Landroid/graphics/Bitmap;

    invoke-virtual {p2, v4}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    .line 287
    :cond_0
    :goto_0
    return-void

    .line 258
    :cond_1
    invoke-static {p1, p2}, Lcom/netease/newsreader/util/BaseImageDownloader;->cancelPotentialDownload(Ljava/lang/String;Landroid/widget/ImageView;)Z

    move-result v4

    if-eqz v4, :cond_0

    .line 261
    :try_start_0
    invoke-static {}, Lcom/netease/newsreader/util/BaseImageDownloader;->$SWITCH_TABLE$com$netease$newsreader$util$BaseImageDownloader$Mode()[I

    move-result-object v4

    iget-object v5, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mode:Lcom/netease/newsreader/util/BaseImageDownloader$Mode;

    invoke-virtual {v5}, Lcom/netease/newsreader/util/BaseImageDownloader$Mode;->ordinal()I

    move-result v5

    aget v4, v4, v5

    packed-switch v4, :pswitch_data_0

    goto :goto_0

    .line 263
    :pswitch_0
    invoke-virtual {p0, p1}, Lcom/netease/newsreader/util/BaseImageDownloader;->downloadBitmap(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 264
    .local v0, bitmap:Landroid/graphics/Bitmap;
    invoke-direct {p0, p1, v0}, Lcom/netease/newsreader/util/BaseImageDownloader;->addBitmapToCache(Ljava/lang/String;Landroid/graphics/Bitmap;)V

    .line 265
    invoke-virtual {p2, v0}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 283
    .end local v0           #bitmap:Landroid/graphics/Bitmap;
    :catch_0
    move-exception v2

    .line 284
    .local v2, e:Ljava/lang/Exception;
    invoke-virtual {v2}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_0

    .line 269
    .end local v2           #e:Ljava/lang/Exception;
    :pswitch_1
    :try_start_1
    new-instance v3, Lcom/netease/newsreader/util/BaseImageDownloader$BitmapDownloaderTask;

    invoke-direct {v3, p0, p2}, Lcom/netease/newsreader/util/BaseImageDownloader$BitmapDownloaderTask;-><init>(Lcom/netease/newsreader/util/BaseImageDownloader;Landroid/widget/ImageView;)V

    .line 270
    .local v3, task:Lcom/netease/newsreader/util/BaseImageDownloader$BitmapDownloaderTask;
    const/4 v4, 0x1

    new-array v4, v4, [Ljava/lang/String;

    const/4 v5, 0x0

    aput-object p1, v4, v5

    invoke-virtual {v3, v4}, Lcom/netease/newsreader/util/BaseImageDownloader$BitmapDownloaderTask;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    goto :goto_0

    .line 274
    .end local v3           #task:Lcom/netease/newsreader/util/BaseImageDownloader$BitmapDownloaderTask;
    :pswitch_2
    new-instance v3, Lcom/netease/newsreader/util/BaseImageDownloader$BitmapDownloaderTask;

    invoke-direct {v3, p0, p2}, Lcom/netease/newsreader/util/BaseImageDownloader$BitmapDownloaderTask;-><init>(Lcom/netease/newsreader/util/BaseImageDownloader;Landroid/widget/ImageView;)V

    .line 275
    .restart local v3       #task:Lcom/netease/newsreader/util/BaseImageDownloader$BitmapDownloaderTask;
    new-instance v1, Lcom/netease/newsreader/util/BaseImageDownloader$DownloadedDrawable;

    iget-object v4, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mContext:Landroid/content/Context;

    invoke-virtual {v4}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v4

    iget-object v5, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mDefaultBm:Landroid/graphics/Bitmap;

    invoke-direct {v1, v4, v3, v5}, Lcom/netease/newsreader/util/BaseImageDownloader$DownloadedDrawable;-><init>(Landroid/content/res/Resources;Lcom/netease/newsreader/util/BaseImageDownloader$BitmapDownloaderTask;Landroid/graphics/Bitmap;)V

    .line 276
    .local v1, downloadedDrawable:Lcom/netease/newsreader/util/BaseImageDownloader$DownloadedDrawable;
    if-eqz v1, :cond_2

    .line 277
    invoke-virtual {p2, v1}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 280
    :cond_2
    const/4 v4, 0x1

    new-array v4, v4, [Ljava/lang/String;

    const/4 v5, 0x0

    aput-object p1, v4, v5

    invoke-virtual {v3, v4}, Lcom/netease/newsreader/util/BaseImageDownloader$BitmapDownloaderTask;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_0

    .line 261
    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_1
        :pswitch_2
    .end packed-switch
.end method

.method private static getBitmapDownloaderTask(Landroid/widget/ImageView;)Lcom/netease/newsreader/util/BaseImageDownloader$BitmapDownloaderTask;
    .locals 3
    .parameter "imageView"

    .prologue
    .line 336
    if-eqz p0, :cond_0

    .line 337
    invoke-virtual {p0}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;

    move-result-object v1

    .line 338
    .local v1, drawable:Landroid/graphics/drawable/Drawable;
    instance-of v2, v1, Lcom/netease/newsreader/util/BaseImageDownloader$DownloadedDrawable;

    if-eqz v2, :cond_0

    move-object v0, v1

    .line 339
    check-cast v0, Lcom/netease/newsreader/util/BaseImageDownloader$DownloadedDrawable;

    .line 340
    .local v0, downloadedDrawable:Lcom/netease/newsreader/util/BaseImageDownloader$DownloadedDrawable;
    invoke-virtual {v0}, Lcom/netease/newsreader/util/BaseImageDownloader$DownloadedDrawable;->getBitmapDownloaderTask()Lcom/netease/newsreader/util/BaseImageDownloader$BitmapDownloaderTask;

    move-result-object v2

    .line 343
    .end local v0           #downloadedDrawable:Lcom/netease/newsreader/util/BaseImageDownloader$DownloadedDrawable;
    .end local v1           #drawable:Landroid/graphics/drawable/Drawable;
    :goto_0
    return-object v2

    :cond_0
    const/4 v2, 0x0

    goto :goto_0
.end method

.method private getBitmapFromCache(Ljava/lang/String;)Landroid/graphics/Bitmap;
    .locals 4
    .parameter "url"

    .prologue
    .line 699
    :try_start_0
    iget-object v3, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->sHardBitmapCache:Ljava/util/HashMap;

    monitor-enter v3
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 700
    :try_start_1
    iget-object v2, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->sHardBitmapCache:Ljava/util/HashMap;

    invoke-virtual {v2, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/graphics/Bitmap;

    .line 701
    .local v0, bitmap:Landroid/graphics/Bitmap;
    if-eqz v0, :cond_1

    .line 704
    iget-object v2, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->sHardBitmapCache:Ljava/util/HashMap;

    invoke-virtual {v2, p1}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    .line 705
    iget-object v2, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->sHardBitmapCache:Ljava/util/HashMap;

    invoke-virtual {v2, p1, v0}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 706
    monitor-exit v3

    .line 725
    .end local v0           #bitmap:Landroid/graphics/Bitmap;
    :cond_0
    :goto_0
    return-object v0

    .line 699
    .restart local v0       #bitmap:Landroid/graphics/Bitmap;
    :cond_1
    monitor-exit v3
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 711
    :try_start_2
    sget-object v2, Lcom/netease/newsreader/util/BaseImageDownloader;->sSoftBitmapCache:Ljava/util/concurrent/ConcurrentHashMap;

    invoke-virtual {v2, p1}, Ljava/util/concurrent/ConcurrentHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/ref/SoftReference;

    .line 712
    .local v1, bitmapReference:Ljava/lang/ref/SoftReference;,"Ljava/lang/ref/SoftReference<Landroid/graphics/Bitmap;>;"
    if-eqz v1, :cond_2

    .line 713
    invoke-virtual {v1}, Ljava/lang/ref/SoftReference;->get()Ljava/lang/Object;

    move-result-object v0

    .end local v0           #bitmap:Landroid/graphics/Bitmap;
    check-cast v0, Landroid/graphics/Bitmap;

    .line 714
    .restart local v0       #bitmap:Landroid/graphics/Bitmap;
    if-nez v0, :cond_0

    .line 719
    sget-object v2, Lcom/netease/newsreader/util/BaseImageDownloader;->sSoftBitmapCache:Ljava/util/concurrent/ConcurrentHashMap;

    invoke-virtual {v2, p1}, Ljava/util/concurrent/ConcurrentHashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0

    .line 725
    .end local v0           #bitmap:Landroid/graphics/Bitmap;
    .end local v1           #bitmapReference:Ljava/lang/ref/SoftReference;,"Ljava/lang/ref/SoftReference<Landroid/graphics/Bitmap;>;"
    :cond_2
    :goto_1
    const/4 v0, 0x0

    goto :goto_0

    .line 699
    :catchall_0
    move-exception v2

    :try_start_3
    monitor-exit v3
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    :try_start_4
    throw v2
    :try_end_4
    .catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_0

    .line 722
    :catch_0
    move-exception v2

    goto :goto_1
.end method

.method private resetPurgeTimer()V
    .locals 4

    .prologue
    .line 741
    iget-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->purgeHandler:Landroid/os/Handler;

    iget-object v1, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->purger:Ljava/lang/Runnable;

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V

    .line 742
    iget-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->purgeHandler:Landroid/os/Handler;

    iget-object v1, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->purger:Ljava/lang/Runnable;

    const-wide/32 v2, 0xea60

    invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

    .line 743
    return-void
.end method


# virtual methods
.method public clearCache()V
    .locals 1

    .prologue
    .line 733
    iget-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->sHardBitmapCache:Ljava/util/HashMap;

    invoke-virtual {v0}, Ljava/util/HashMap;->clear()V

    .line 734
    sget-object v0, Lcom/netease/newsreader/util/BaseImageDownloader;->sSoftBitmapCache:Ljava/util/concurrent/ConcurrentHashMap;

    invoke-virtual {v0}, Ljava/util/concurrent/ConcurrentHashMap;->clear()V

    .line 735
    return-void
.end method

.method public download(Ljava/lang/String;Landroid/widget/ImageView;)V
    .locals 7
    .parameter "url"
    .parameter "imageView"

    .prologue
    .line 117
    invoke-direct {p0}, Lcom/netease/newsreader/util/BaseImageDownloader;->resetPurgeTimer()V

    .line 118
    const/4 v0, 0x0

    .line 119
    .local v0, bitmap:Landroid/graphics/Bitmap;
    invoke-direct {p0, p1}, Lcom/netease/newsreader/util/BaseImageDownloader;->getBitmapFromCache(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 120
    const/4 v1, 0x0

    .line 121
    .local v1, bitmapReference:Ljava/lang/ref/WeakReference;,"Ljava/lang/ref/WeakReference<Landroid/graphics/Bitmap;>;"
    if-nez v0, :cond_0

    .line 122
    const-string v3, "/"

    invoke-virtual {p1, v3}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v3

    add-int/lit8 v3, v3, 0x1

    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v4

    invoke-virtual {p1, v3, v4}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Lcom/netease/newsreader/util/PicUtil;->isLocalPicExit(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_0

    .line 125
    iget v3, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapW:I

    if-eqz v3, :cond_2

    iget v3, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapH:I

    if-eqz v3, :cond_2

    .line 126
    new-instance v1, Ljava/lang/ref/WeakReference;

    .end local v1           #bitmapReference:Ljava/lang/ref/WeakReference;,"Ljava/lang/ref/WeakReference<Landroid/graphics/Bitmap;>;"
    iget-object v3, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mContext:Landroid/content/Context;

    .line 127
    const-string v4, "/"

    invoke-virtual {p1, v4}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v4

    add-int/lit8 v4, v4, 0x1

    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v5

    invoke-virtual {p1, v4, v5}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v4

    invoke-static {v4}, Lcom/netease/newsreader/util/PicUtil;->readTempJPEGFile(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v4

    .line 128
    iget v5, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapW:I

    iget v6, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapH:I

    .line 126
    invoke-static {v3, v4, v5, v6}, Lcom/netease/newsreader/util/PicUtil;->resizeBitmap(Landroid/content/Context;Landroid/graphics/Bitmap;II)Landroid/graphics/Bitmap;

    move-result-object v3

    invoke-direct {v1, v3}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    .line 130
    .restart local v1       #bitmapReference:Ljava/lang/ref/WeakReference;,"Ljava/lang/ref/WeakReference<Landroid/graphics/Bitmap;>;"
    :goto_0
    invoke-virtual {v1}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    .end local v0           #bitmap:Landroid/graphics/Bitmap;
    check-cast v0, Landroid/graphics/Bitmap;

    .line 134
    .restart local v0       #bitmap:Landroid/graphics/Bitmap;
    :cond_0
    if-nez v0, :cond_4

    .line 135
    iget-object v3, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->set_prefs:Landroid/content/SharedPreferences;

    const-string v4, "downpic"

    const/4 v5, 0x0

    invoke-interface {v3, v4, v5}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z

    move-result v2

    .line 136
    .local v2, downpic:Z
    iget-object v3, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mContext:Landroid/content/Context;

    invoke-static {v2, v3}, Lcom/netease/newsreader/util/Tools;->isshowimg(ZLandroid/content/Context;)Z

    move-result v3

    if-eqz v3, :cond_3

    .line 137
    invoke-direct {p0, p1, p2}, Lcom/netease/newsreader/util/BaseImageDownloader;->forceDownload(Ljava/lang/String;Landroid/widget/ImageView;)V

    .line 148
    .end local v2           #downpic:Z
    :cond_1
    :goto_1
    return-void

    .line 129
    :cond_2
    new-instance v1, Ljava/lang/ref/WeakReference;

    .end local v1           #bitmapReference:Ljava/lang/ref/WeakReference;,"Ljava/lang/ref/WeakReference<Landroid/graphics/Bitmap;>;"
    const-string v3, "/"

    invoke-virtual {p1, v3}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v3

    add-int/lit8 v3, v3, 0x1

    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v4

    invoke-virtual {p1, v3, v4}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Lcom/netease/newsreader/util/PicUtil;->readTempJPEGFile(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v3

    invoke-direct {v1, v3}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    .restart local v1       #bitmapReference:Ljava/lang/ref/WeakReference;,"Ljava/lang/ref/WeakReference<Landroid/graphics/Bitmap;>;"
    goto :goto_0

    .line 139
    .restart local v2       #downpic:Z
    :cond_3
    iget-object v3, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mDefaultBm:Landroid/graphics/Bitmap;

    if-eqz v3, :cond_1

    .line 140
    iget-object v3, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mDefaultBm:Landroid/graphics/Bitmap;

    invoke-virtual {p2, v3}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    goto :goto_1

    .line 145
    .end local v2           #downpic:Z
    :cond_4
    invoke-static {p1, p2}, Lcom/netease/newsreader/util/BaseImageDownloader;->cancelPotentialDownload(Ljava/lang/String;Landroid/widget/ImageView;)Z

    .line 146
    invoke-virtual {p2, v0}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    goto :goto_1
.end method

.method downloadBitmap(Ljava/lang/String;)Landroid/graphics/Bitmap;
    .locals 12
    .parameter "url"

    .prologue
    .line 406
    if-eqz p1, :cond_0

    :try_start_0
    const-string v9, ""

    invoke-virtual {p1, v9}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v9

    if-eqz v9, :cond_1

    .line 407
    :cond_0
    iget-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mDefaultBm:Landroid/graphics/Bitmap;

    .line 447
    :goto_0
    return-object v0

    .line 409
    :cond_1
    new-instance v4, Lorg/apache/http/params/BasicHttpParams;

    invoke-direct {v4}, Lorg/apache/http/params/BasicHttpParams;-><init>()V

    .line 410
    .local v4, httpParams:Lorg/apache/http/params/HttpParams;
    const/16 v9, 0x7530

    invoke-static {v4, v9}, Lorg/apache/http/params/HttpConnectionParams;->setConnectionTimeout(Lorg/apache/http/params/HttpParams;I)V

    .line 411
    const/16 v9, 0x7530

    invoke-static {v4, v9}, Lorg/apache/http/params/HttpConnectionParams;->setSoTimeout(Lorg/apache/http/params/HttpParams;I)V

    .line 412
    invoke-static {v4}, Lcom/netease/newsreader/util/NeteaseHttpClient;->getHttpClient(Lorg/apache/http/params/HttpParams;)Lorg/apache/http/impl/client/DefaultHttpClient;

    move-result-object v3

    .line 413
    .local v3, httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    iget-object v9, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mContext:Landroid/content/Context;

    invoke-static {v9}, Lcom/netease/newsreader/util/Tools;->isCMWAPMobileNet(Landroid/content/Context;)Z

    move-result v9

    if-eqz v9, :cond_2

    .line 414
    new-instance v6, Lorg/apache/http/HttpHost;

    const-string v9, "10.0.0.172"

    const/16 v10, 0x50

    const-string v11, "http"

    invoke-direct {v6, v9, v10, v11}, Lorg/apache/http/HttpHost;-><init>(Ljava/lang/String;ILjava/lang/String;)V

    .line 415
    .local v6, proxy:Lorg/apache/http/HttpHost;
    invoke-virtual {v3}, Lorg/apache/http/impl/client/DefaultHttpClient;->getParams()Lorg/apache/http/params/HttpParams;

    move-result-object v9

    const-string v10, "http.route.default-proxy"

    invoke-interface {v9, v10, v6}, Lorg/apache/http/params/HttpParams;->setParameter(Ljava/lang/String;Ljava/lang/Object;)Lorg/apache/http/params/HttpParams;

    .line 419
    .end local v6           #proxy:Lorg/apache/http/HttpHost;
    :goto_1
    new-instance v7, Lorg/apache/http/client/methods/HttpGet;

    invoke-direct {v7, p1}, Lorg/apache/http/client/methods/HttpGet;-><init>(Ljava/lang/String;)V

    .line 420
    .local v7, request:Lorg/apache/http/client/methods/HttpGet;
    invoke-virtual {v3, v7}, Lorg/apache/http/impl/client/DefaultHttpClient;->execute(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/HttpResponse;

    move-result-object v8

    .line 421
    .local v8, response:Lorg/apache/http/HttpResponse;
    invoke-interface {v8}, Lorg/apache/http/HttpResponse;->getEntity()Lorg/apache/http/HttpEntity;

    move-result-object v2

    .line 422
    .local v2, entity:Lorg/apache/http/HttpEntity;
    invoke-interface {v2}, Lorg/apache/http/HttpEntity;->getContent()Ljava/io/InputStream;

    move-result-object v5

    .line 424
    .local v5, is:Ljava/io/InputStream;
    if-nez v5, :cond_3

    .line 425
    iget-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mDefaultBm:Landroid/graphics/Bitmap;

    goto :goto_0

    .line 417
    .end local v2           #entity:Lorg/apache/http/HttpEntity;
    .end local v5           #is:Ljava/io/InputStream;
    .end local v7           #request:Lorg/apache/http/client/methods/HttpGet;
    .end local v8           #response:Lorg/apache/http/HttpResponse;
    :cond_2
    invoke-virtual {v3}, Lorg/apache/http/impl/client/DefaultHttpClient;->getParams()Lorg/apache/http/params/HttpParams;

    move-result-object v9

    const-string v10, "http.route.default-proxy"

    invoke-interface {v9, v10}, Lorg/apache/http/params/HttpParams;->removeParameter(Ljava/lang/String;)Z
    :try_end_0
    .catch Ljava/lang/OutOfMemoryError; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    goto :goto_1

    .line 443
    .end local v3           #httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .end local v4           #httpParams:Lorg/apache/http/params/HttpParams;
    :catch_0
    move-exception v1

    .line 444
    .local v1, e:Ljava/lang/OutOfMemoryError;
    iget-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mDefaultBm:Landroid/graphics/Bitmap;

    goto :goto_0

    .line 427
    .end local v1           #e:Ljava/lang/OutOfMemoryError;
    .restart local v2       #entity:Lorg/apache/http/HttpEntity;
    .restart local v3       #httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .restart local v4       #httpParams:Lorg/apache/http/params/HttpParams;
    .restart local v5       #is:Ljava/io/InputStream;
    .restart local v7       #request:Lorg/apache/http/client/methods/HttpGet;
    .restart local v8       #response:Lorg/apache/http/HttpResponse;
    :cond_3
    :try_start_1
    new-instance v9, Lcom/netease/newsreader/util/BaseImageDownloader$FlushedInputStream;

    invoke-direct {v9, v5}, Lcom/netease/newsreader/util/BaseImageDownloader$FlushedInputStream;-><init>(Ljava/io/InputStream;)V

    invoke-static {v9}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 428
    .local v0, bm:Landroid/graphics/Bitmap;
    iget v9, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapW:I

    if-eqz v9, :cond_4

    iget v9, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapH:I

    if-eqz v9, :cond_4

    iget-object v9, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->cut:Ljava/lang/String;

    if-nez v9, :cond_4

    .line 429
    iget-object v9, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mContext:Landroid/content/Context;

    iget v10, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapW:I

    iget v11, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapH:I

    invoke-static {v9, v0, v10, v11}, Lcom/netease/newsreader/util/PicUtil;->resizeBitmap(Landroid/content/Context;Landroid/graphics/Bitmap;II)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 431
    :cond_4
    const-string v9, "Y"

    iget-object v10, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->cut:Ljava/lang/String;

    invoke-virtual {v9, v10}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v9

    if-eqz v9, :cond_5

    .line 432
    iget v9, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapW:I

    iget v10, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapH:I

    invoke-static {v0, v9, v10}, Lcom/netease/newsreader/util/PicUtil;->cutBitmap(Landroid/graphics/Bitmap;II)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 434
    :cond_5
    if-eqz v0, :cond_6

    .line 435
    const-string v9, "/"

    invoke-virtual {p1, v9}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v9

    add-int/lit8 v9, v9, 0x1

    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v10

    invoke-virtual {p1, v9, v10}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v9

    invoke-static {v9, v0}, Lcom/netease/newsreader/util/PicUtil;->saveMyBitmap(Ljava/lang/String;Landroid/graphics/Bitmap;)Z

    .line 440
    :cond_6
    invoke-virtual {v5}, Ljava/io/InputStream;->close()V

    .line 441
    invoke-interface {v2}, Lorg/apache/http/HttpEntity;->consumeContent()V
    :try_end_1
    .catch Ljava/lang/OutOfMemoryError; {:try_start_1 .. :try_end_1} :catch_0
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1

    goto/16 :goto_0

    .line 445
    .end local v0           #bm:Landroid/graphics/Bitmap;
    .end local v2           #entity:Lorg/apache/http/HttpEntity;
    .end local v3           #httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .end local v4           #httpParams:Lorg/apache/http/params/HttpParams;
    .end local v5           #is:Ljava/io/InputStream;
    .end local v7           #request:Lorg/apache/http/client/methods/HttpGet;
    .end local v8           #response:Lorg/apache/http/HttpResponse;
    :catch_1
    move-exception v1

    .line 447
    .local v1, e:Ljava/lang/Exception;
    iget-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mDefaultBm:Landroid/graphics/Bitmap;

    goto/16 :goto_0
.end method

.method downloadBitmap(Ljava/lang/String;Lorg/apache/http/client/methods/HttpGet;)Landroid/graphics/Bitmap;
    .locals 11
    .parameter "url"
    .parameter "request"

    .prologue
    .line 456
    if-eqz p1, :cond_0

    :try_start_0
    const-string v8, ""

    invoke-virtual {p1, v8}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v8

    if-eqz v8, :cond_1

    .line 457
    :cond_0
    iget-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mDefaultBm:Landroid/graphics/Bitmap;

    .line 496
    :goto_0
    return-object v0

    .line 459
    :cond_1
    new-instance v4, Lorg/apache/http/params/BasicHttpParams;

    invoke-direct {v4}, Lorg/apache/http/params/BasicHttpParams;-><init>()V

    .line 460
    .local v4, httpParams:Lorg/apache/http/params/HttpParams;
    const/16 v8, 0x7530

    invoke-static {v4, v8}, Lorg/apache/http/params/HttpConnectionParams;->setConnectionTimeout(Lorg/apache/http/params/HttpParams;I)V

    .line 461
    const/16 v8, 0x7530

    invoke-static {v4, v8}, Lorg/apache/http/params/HttpConnectionParams;->setSoTimeout(Lorg/apache/http/params/HttpParams;I)V

    .line 462
    invoke-static {v4}, Lcom/netease/newsreader/util/NeteaseHttpClient;->getHttpClient(Lorg/apache/http/params/HttpParams;)Lorg/apache/http/impl/client/DefaultHttpClient;

    move-result-object v3

    .line 463
    .local v3, httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    iget-object v8, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mContext:Landroid/content/Context;

    invoke-static {v8}, Lcom/netease/newsreader/util/Tools;->isCMWAPMobileNet(Landroid/content/Context;)Z

    move-result v8

    if-eqz v8, :cond_2

    .line 464
    new-instance v6, Lorg/apache/http/HttpHost;

    const-string v8, "10.0.0.172"

    const/16 v9, 0x50

    const-string v10, "http"

    invoke-direct {v6, v8, v9, v10}, Lorg/apache/http/HttpHost;-><init>(Ljava/lang/String;ILjava/lang/String;)V

    .line 465
    .local v6, proxy:Lorg/apache/http/HttpHost;
    invoke-virtual {v3}, Lorg/apache/http/impl/client/DefaultHttpClient;->getParams()Lorg/apache/http/params/HttpParams;

    move-result-object v8

    const-string v9, "http.route.default-proxy"

    invoke-interface {v8, v9, v6}, Lorg/apache/http/params/HttpParams;->setParameter(Ljava/lang/String;Ljava/lang/Object;)Lorg/apache/http/params/HttpParams;

    .line 469
    .end local v6           #proxy:Lorg/apache/http/HttpHost;
    :goto_1
    invoke-virtual {v3, p2}, Lorg/apache/http/impl/client/DefaultHttpClient;->execute(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/HttpResponse;

    move-result-object v7

    .line 470
    .local v7, response:Lorg/apache/http/HttpResponse;
    invoke-interface {v7}, Lorg/apache/http/HttpResponse;->getEntity()Lorg/apache/http/HttpEntity;

    move-result-object v2

    .line 471
    .local v2, entity:Lorg/apache/http/HttpEntity;
    invoke-interface {v2}, Lorg/apache/http/HttpEntity;->getContent()Ljava/io/InputStream;

    move-result-object v5

    .line 473
    .local v5, is:Ljava/io/InputStream;
    if-nez v5, :cond_3

    .line 474
    iget-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mDefaultBm:Landroid/graphics/Bitmap;

    goto :goto_0

    .line 467
    .end local v2           #entity:Lorg/apache/http/HttpEntity;
    .end local v5           #is:Ljava/io/InputStream;
    .end local v7           #response:Lorg/apache/http/HttpResponse;
    :cond_2
    invoke-virtual {v3}, Lorg/apache/http/impl/client/DefaultHttpClient;->getParams()Lorg/apache/http/params/HttpParams;

    move-result-object v8

    const-string v9, "http.route.default-proxy"

    invoke-interface {v8, v9}, Lorg/apache/http/params/HttpParams;->removeParameter(Ljava/lang/String;)Z
    :try_end_0
    .catch Ljava/lang/OutOfMemoryError; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    goto :goto_1

    .line 492
    .end local v3           #httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .end local v4           #httpParams:Lorg/apache/http/params/HttpParams;
    :catch_0
    move-exception v1

    .line 493
    .local v1, e:Ljava/lang/OutOfMemoryError;
    iget-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mDefaultBm:Landroid/graphics/Bitmap;

    goto :goto_0

    .line 476
    .end local v1           #e:Ljava/lang/OutOfMemoryError;
    .restart local v2       #entity:Lorg/apache/http/HttpEntity;
    .restart local v3       #httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .restart local v4       #httpParams:Lorg/apache/http/params/HttpParams;
    .restart local v5       #is:Ljava/io/InputStream;
    .restart local v7       #response:Lorg/apache/http/HttpResponse;
    :cond_3
    :try_start_1
    new-instance v8, Lcom/netease/newsreader/util/BaseImageDownloader$FlushedInputStream;

    invoke-direct {v8, v5}, Lcom/netease/newsreader/util/BaseImageDownloader$FlushedInputStream;-><init>(Ljava/io/InputStream;)V

    invoke-static {v8}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 477
    .local v0, bm:Landroid/graphics/Bitmap;
    iget v8, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapW:I

    if-eqz v8, :cond_4

    iget v8, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapH:I

    if-eqz v8, :cond_4

    iget-object v8, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->cut:Ljava/lang/String;

    if-nez v8, :cond_4

    .line 478
    iget-object v8, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mContext:Landroid/content/Context;

    iget v9, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapW:I

    iget v10, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapH:I

    invoke-static {v8, v0, v9, v10}, Lcom/netease/newsreader/util/PicUtil;->resizeBitmap(Landroid/content/Context;Landroid/graphics/Bitmap;II)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 480
    :cond_4
    const-string v8, "Y"

    iget-object v9, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->cut:Ljava/lang/String;

    invoke-virtual {v8, v9}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v8

    if-eqz v8, :cond_5

    .line 481
    iget v8, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapW:I

    iget v9, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapH:I

    invoke-static {v0, v8, v9}, Lcom/netease/newsreader/util/PicUtil;->cutBitmap(Landroid/graphics/Bitmap;II)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 483
    :cond_5
    if-eqz v0, :cond_6

    .line 484
    const-string v8, "/"

    invoke-virtual {p1, v8}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v8

    add-int/lit8 v8, v8, 0x1

    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v9

    invoke-virtual {p1, v8, v9}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v8

    invoke-static {v8, v0}, Lcom/netease/newsreader/util/PicUtil;->saveMyBitmap(Ljava/lang/String;Landroid/graphics/Bitmap;)Z

    .line 489
    :cond_6
    invoke-virtual {v5}, Ljava/io/InputStream;->close()V

    .line 490
    invoke-interface {v2}, Lorg/apache/http/HttpEntity;->consumeContent()V
    :try_end_1
    .catch Ljava/lang/OutOfMemoryError; {:try_start_1 .. :try_end_1} :catch_0
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1

    goto/16 :goto_0

    .line 494
    .end local v0           #bm:Landroid/graphics/Bitmap;
    .end local v2           #entity:Lorg/apache/http/HttpEntity;
    .end local v3           #httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .end local v4           #httpParams:Lorg/apache/http/params/HttpParams;
    .end local v5           #is:Ljava/io/InputStream;
    .end local v7           #response:Lorg/apache/http/HttpResponse;
    :catch_1
    move-exception v1

    .line 496
    .local v1, e:Ljava/lang/Exception;
    iget-object v0, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mDefaultBm:Landroid/graphics/Bitmap;

    goto/16 :goto_0
.end method

.method public downloadPictures(Ljava/lang/String;Landroid/widget/ImageView;IILjava/lang/String;Landroid/graphics/Bitmap;Ljava/lang/String;)V
    .locals 6
    .parameter "imgUrl"
    .parameter "imageView"
    .parameter "w"
    .parameter "h"
    .parameter "c"
    .parameter "map"
    .parameter "f"

    .prologue
    .line 161
    iput p3, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapW:I

    .line 162
    iput p4, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapH:I

    .line 163
    iput-object p5, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->cut:Ljava/lang/String;

    .line 164
    iput-object p7, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->flag:Ljava/lang/String;

    .line 165
    iput-object p6, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mDefaultBm:Landroid/graphics/Bitmap;

    .line 167
    if-eqz p1, :cond_0

    const-string v3, ""

    invoke-virtual {p1, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_2

    .line 168
    :cond_0
    invoke-virtual {p2, p6}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    .line 206
    :cond_1
    :goto_0
    return-void

    .line 170
    :cond_2
    const/4 v1, 0x0

    .line 172
    .local v1, bitmapReference:Ljava/lang/ref/WeakReference;,"Ljava/lang/ref/WeakReference<Landroid/graphics/Bitmap;>;"
    const/4 v0, 0x0

    .line 174
    .local v0, bitmap:Landroid/graphics/Bitmap;
    invoke-direct {p0}, Lcom/netease/newsreader/util/BaseImageDownloader;->resetPurgeTimer()V

    .line 176
    const-string v3, "http://"

    invoke-virtual {p1, v3}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v3

    if-nez v3, :cond_3

    .line 177
    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "http://"

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    .line 181
    :cond_3
    invoke-static {p1, p3, p4}, Lcom/netease/newsreader/util/PicUtil;->get3G_PhotoResize(Ljava/lang/String;II)Ljava/lang/String;

    move-result-object p1

    .line 183
    const-string v3, "img.tostring()"

    invoke-static {v3, p1}, Lcom/netease/newsreader/util/Logger;->i(Ljava/lang/String;Ljava/lang/String;)V

    .line 184
    invoke-direct {p0, p1}, Lcom/netease/newsreader/util/BaseImageDownloader;->getBitmapFromCache(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 186
    if-nez v0, :cond_4

    .line 187
    const-string v3, "/"

    invoke-virtual {p1, v3}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v3

    add-int/lit8 v3, v3, 0x1

    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v4

    invoke-virtual {p1, v3, v4}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Lcom/netease/newsreader/util/PicUtil;->isLocalPicExit(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_4

    .line 189
    new-instance v1, Ljava/lang/ref/WeakReference;

    .end local v1           #bitmapReference:Ljava/lang/ref/WeakReference;,"Ljava/lang/ref/WeakReference<Landroid/graphics/Bitmap;>;"
    const-string v3, "/"

    invoke-virtual {p1, v3}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v3

    add-int/lit8 v3, v3, 0x1

    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v4

    invoke-virtual {p1, v3, v4}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Lcom/netease/newsreader/util/PicUtil;->readTempJPEGFile(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v3

    invoke-direct {v1, v3}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    .line 190
    .restart local v1       #bitmapReference:Ljava/lang/ref/WeakReference;,"Ljava/lang/ref/WeakReference<Landroid/graphics/Bitmap;>;"
    invoke-virtual {v1}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    .end local v0           #bitmap:Landroid/graphics/Bitmap;
    check-cast v0, Landroid/graphics/Bitmap;

    .line 194
    .restart local v0       #bitmap:Landroid/graphics/Bitmap;
    :cond_4
    if-nez v0, :cond_5

    .line 195
    iget-object v3, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->set_prefs:Landroid/content/SharedPreferences;

    const-string v4, "downpic"

    const/4 v5, 0x0

    invoke-interface {v3, v4, v5}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z

    move-result v2

    .line 196
    .local v2, downpic:Z
    iget-object v3, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mContext:Landroid/content/Context;

    invoke-static {v2, v3}, Lcom/netease/newsreader/util/Tools;->isshowimg(ZLandroid/content/Context;)Z

    move-result v3

    if-eqz v3, :cond_1

    .line 197
    invoke-virtual {p1}, Ljava/lang/String;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-direct {p0, v3, p2}, Lcom/netease/newsreader/util/BaseImageDownloader;->forceDownload(Ljava/lang/String;Landroid/widget/ImageView;)V

    goto :goto_0

    .line 200
    .end local v2           #downpic:Z
    :cond_5
    invoke-virtual {p1}, Ljava/lang/String;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v3, p2}, Lcom/netease/newsreader/util/BaseImageDownloader;->cancelPotentialDownload(Ljava/lang/String;Landroid/widget/ImageView;)Z

    .line 201
    invoke-virtual {p2, v0}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    goto/16 :goto_0
.end method

.method public downloadVoteImage(Ljava/lang/String;Landroid/widget/ImageView;)V
    .locals 5
    .parameter "url"
    .parameter "imageView"

    .prologue
    .line 214
    invoke-direct {p0}, Lcom/netease/newsreader/util/BaseImageDownloader;->resetPurgeTimer()V

    .line 215
    const/4 v0, 0x0

    .line 216
    .local v0, bitmap:Landroid/graphics/Bitmap;
    invoke-direct {p0, p1}, Lcom/netease/newsreader/util/BaseImageDownloader;->getBitmapFromCache(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 217
    const/4 v1, 0x0

    .line 219
    .local v1, bitmapReference:Ljava/lang/ref/WeakReference;,"Ljava/lang/ref/WeakReference<Landroid/graphics/Bitmap;>;"
    if-nez v0, :cond_0

    .line 220
    const-string v2, "/"

    invoke-virtual {p1, v2}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v2

    add-int/lit8 v2, v2, 0x1

    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v3

    invoke-virtual {p1, v2, v3}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lcom/netease/newsreader/util/PicUtil;->isLocalPicExit(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_0

    .line 228
    iget v2, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapW:I

    if-eqz v2, :cond_1

    iget v2, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapH:I

    if-eqz v2, :cond_1

    .line 229
    new-instance v1, Ljava/lang/ref/WeakReference;

    .end local v1           #bitmapReference:Ljava/lang/ref/WeakReference;,"Ljava/lang/ref/WeakReference<Landroid/graphics/Bitmap;>;"
    const-string v2, "/"

    invoke-virtual {p1, v2}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v2

    add-int/lit8 v2, v2, 0x1

    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v3

    invoke-virtual {p1, v2, v3}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lcom/netease/newsreader/util/PicUtil;->readTempJPEGFile(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v2

    .line 230
    iget v3, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapW:I

    iget v4, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapH:I

    .line 229
    invoke-static {v2, v3, v4}, Lcom/netease/newsreader/util/PicUtil;->cutBitmap(Landroid/graphics/Bitmap;II)Landroid/graphics/Bitmap;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    .line 232
    .restart local v1       #bitmapReference:Ljava/lang/ref/WeakReference;,"Ljava/lang/ref/WeakReference<Landroid/graphics/Bitmap;>;"
    :goto_0
    invoke-virtual {v1}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    .end local v0           #bitmap:Landroid/graphics/Bitmap;
    check-cast v0, Landroid/graphics/Bitmap;

    .line 236
    .restart local v0       #bitmap:Landroid/graphics/Bitmap;
    :cond_0
    if-nez v0, :cond_2

    .line 237
    invoke-direct {p0, p1, p2}, Lcom/netease/newsreader/util/BaseImageDownloader;->forceDownload(Ljava/lang/String;Landroid/widget/ImageView;)V

    .line 242
    :goto_1
    return-void

    .line 231
    :cond_1
    new-instance v1, Ljava/lang/ref/WeakReference;

    .end local v1           #bitmapReference:Ljava/lang/ref/WeakReference;,"Ljava/lang/ref/WeakReference<Landroid/graphics/Bitmap;>;"
    const-string v2, "/"

    invoke-virtual {p1, v2}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v2

    add-int/lit8 v2, v2, 0x1

    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v3

    invoke-virtual {p1, v2, v3}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lcom/netease/newsreader/util/PicUtil;->readTempJPEGFile(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    .restart local v1       #bitmapReference:Ljava/lang/ref/WeakReference;,"Ljava/lang/ref/WeakReference<Landroid/graphics/Bitmap;>;"
    goto :goto_0

    .line 239
    :cond_2
    invoke-static {p1, p2}, Lcom/netease/newsreader/util/BaseImageDownloader;->cancelPotentialDownload(Ljava/lang/String;Landroid/widget/ImageView;)Z

    .line 240
    invoke-virtual {p2, v0}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    goto :goto_1
.end method

.method public getBitmap(Ljava/lang/String;)Landroid/graphics/Bitmap;
    .locals 4
    .parameter "imgUrl"

    .prologue
    .line 82
    const/4 v0, 0x0

    .line 84
    .local v0, bitmap:Landroid/graphics/Bitmap;
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    .line 85
    .local v1, img:Ljava/lang/StringBuilder;
    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 88
    const-string v2, "/"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->lastIndexOf(Ljava/lang/String;)I

    move-result v2

    add-int/lit8 v2, v2, 0x1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->length()I

    move-result v3

    invoke-virtual {v1, v2, v3}, Ljava/lang/StringBuilder;->substring(II)Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lcom/netease/newsreader/util/PicUtil;->isLocalPicExit(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_0

    .line 89
    const-string v2, "/"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->lastIndexOf(Ljava/lang/String;)I

    move-result v2

    add-int/lit8 v2, v2, 0x1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->length()I

    move-result v3

    invoke-virtual {v1, v2, v3}, Ljava/lang/StringBuilder;->substring(II)Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lcom/netease/newsreader/util/PicUtil;->readTempJPEGFile(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 96
    :goto_0
    return-object v0

    .line 93
    :cond_0
    invoke-direct {p0, p1}, Lcom/netease/newsreader/util/BaseImageDownloader;->forceDownload(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v0

    goto :goto_0
.end method

.method public getImageforBatche(Ljava/lang/String;)V
    .locals 3
    .parameter "imgUrl"

    .prologue
    .line 101
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    .line 102
    .local v0, img:Ljava/lang/StringBuilder;
    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 103
    const-string v1, "/"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->lastIndexOf(Ljava/lang/String;)I

    move-result v1

    add-int/lit8 v1, v1, 0x1

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->length()I

    move-result v2

    invoke-virtual {v0, v1, v2}, Ljava/lang/StringBuilder;->substring(II)Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/netease/newsreader/util/PicUtil;->isLocalPicExit(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_0

    .line 104
    invoke-direct {p0, p1}, Lcom/netease/newsreader/util/BaseImageDownloader;->downloadImageforBatche(Ljava/lang/String;)V

    .line 106
    :cond_0
    return-void
.end method

.method public setBitmapWandH(IILjava/lang/String;)V
    .locals 0
    .parameter "w"
    .parameter "h"
    .parameter "c"

    .prologue
    .line 749
    iput p1, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapW:I

    .line 750
    iput p2, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->bitmapH:I

    .line 751
    iput-object p3, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->cut:Ljava/lang/String;

    .line 752
    return-void
.end method

.method public setDefaultBitmap(Landroid/graphics/Bitmap;)V
    .locals 0
    .parameter "bitmap"

    .prologue
    .line 77
    iput-object p1, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mDefaultBm:Landroid/graphics/Bitmap;

    .line 78
    return-void
.end method

.method public setMode(Lcom/netease/newsreader/util/BaseImageDownloader$Mode;)V
    .locals 0
    .parameter "mode"

    .prologue
    .line 639
    iput-object p1, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mode:Lcom/netease/newsreader/util/BaseImageDownloader$Mode;

    .line 640
    invoke-virtual {p0}, Lcom/netease/newsreader/util/BaseImageDownloader;->clearCache()V

    .line 641
    return-void
.end method

.method public setThread(Ljava/lang/Thread;)V
    .locals 0
    .parameter "thread"

    .prologue
    .line 73
    iput-object p1, p0, Lcom/netease/newsreader/util/BaseImageDownloader;->mThread:Ljava/lang/Thread;

    .line 74
    return-void
.end method
